home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14496 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Check if a file exists?
  5. Date: 15 Apr 1996 11:48:49 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4ktd31$8hd@sparcserver.lrz-muenchen.de>
  9. References: <829565947.AA00181@escan.demon.co.uk>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. Bill Birrell <bill@escan.demon.co.uk> writes:
  13.  
  14. > > That would be implemented in Unix using stat(),
  15. > > however that isn't a standard
  16. > > C library function.
  17.  
  18. >    That's odd, Lawrence. K&R Edn 1, Ch 8, P 170 says it is, as part of the
  19. >unix system interface, and refers to sys/stat.h for the definition of the stat
  20. >structure.
  21.  
  22. The _unix system interface_ obviously is _not_ a part of the standard C 
  23. library. 
  24.  
  25. >Compatibility is listed as:-
  26.  
  27. >    unix,
  28. >    16 bit: dos, qwin,win, win dll
  29. >    32 bit: Dos32X
  30.  
  31. I have my doubts that K&R lists "win", "win dll", etc. for stat(), so this
  32. list must come from another source. I would not be so sure that _all_
  33. DOS implementations have stat(). stat() _is_ a POSIX.1 function, so your
  34. chances of finding it on a lot of systems are not bad, but:
  35.  
  36. >    Note:
  37. >    use _stat for compatibility with ANSI naming conventions of non-ANSI
  38. >functions. Use stat and link with OLDNAMES.LIB for UNIX compatibility.
  39.  
  40. This should give you a clue that stat() is _not_ a function from the
  41. standard C library, shouldn't it?
  42.  
  43. Kurt
  44. --
  45. | Kurt Watzka                             Phone : +49-89-2180-6254
  46. | watzka@stat.uni-muenchen.de
  47.